Note: clicking on references from the following list will take you to the appropriate section, whilst clicking on the main headings within the manual will return the view to this list of contents.
1 | Introduction | ||
1.1 | Getting Started | ||
1.2 | Editing Text | ||
1.3 | Marking Text | ||
1.4 | Input focus | ||
1.5 | Updating !System | ||
2 | The Window Menu Entries (Upper) | ||
2.1 | Misc | ||
2.2 | Save | ||
2.3 | Select | ||
2.4 | Edit (including Search) | ||
2.5 | Display | ||
3 | The Window Menu Entries (Lower) | ||
3.1 | Help | ||
3.2 | Language | ||
3.21 | Macros and Key-based Features | ||
3.22 | Auto Indent | ||
3.23 | Basic Import/Export | ||
3.24 | Syntax Checking | ||
3.3 | Quick Search | ||
3.4 | Clipboard | ||
3.5 | Markers, Position Finding and Indexing | ||
3.6 | Set Filetype | ||
3.7 | Text Macros | ||
3.8 | Printing | ||
3.81 | Printer Codes | ||
3.82 | Page Setup | ||
3.83 | Headers and Footers | ||
3.84 | The Hardcopy Option | ||
3.9 | User commands | ||
4 | The Icon Bar Menu | ||
4.1 | Info, Help, Quit etc. | ||
4.2 | User Choices | ||
4.3 | Create New Object | ||
5 | Miscellaneous Features | ||
5.1 | Entering Control Codes | ||
5.2 | Undelete | ||
5.3 | The Dragging Options - File Info & CSD | ||
5.4 | Caret Controller | ||
5.5 | DeskEdit$Options | ||
6 | Getting the Most from DeskEdit | ||
6.1 | Working with Text | ||
6.2 | Working with Basic | ||
6.3 | Working with C Source Code | ||
7 | Keyboard Shortcuts |
With only one exception (DeskEdit has no Task window), the features of Acorn's Edit text editor form a complete subset of those offered by DeskEdit. Moreover Edit's menu structure and keyboard shortcuts have been retained almost in their entirety, so that users familiar with this useful package will have no relearning to do. In this manual, the features of DeskEdit which echo those of Edit will be treated more briefly than its new features, and if the user is unfamiliar with Edit, he will find additional information in the RISC OS User Guide.
To install DeskEdit in your machine, insert the DeskEdit disc, and click on the floppy drive icon. Then double-click on the DeskEdit icon in the directory viewer. This will install DeskEdit's icon on the icon bar.
If you get the error message "Old C Library" when you first run DeskEdit, you will need to update your current version of the C Library file CLib (see section 1.5).
When first installed, DeskEdit's icon will initially incorporate the letter "T" to indicate that it is in Text mode. This mode is used for editing all types of file except for Basic programs and C source code. If a Basic program is loaded into DeskEdit, a letter "B" will be displayed, while C source code will cause a "C" to appear on the icon. A number of DeskEdit's features depend on the current language mode - further details are given in sections 3.2 and 6.
Once DeskEdit has been installed on the icon bar, clicking on its icon with the left-hand or Select button of the mouse will open a new DeskEdit window. By default the window will be in Text mode, and you may type into it to create a text file.
As with with other RISC OS applications, the middle or Menu button of the mouse is used to invoke DeskEdit's menus. There are two of these: one on the icon bar icon, and one in each DeskEdit window that is opened. The latter generally control window-specific features of the package, while the former invoke general features.
To install DeskEdit onto a hard disc, simply open the target directory on your hard disc, and drag DeskEdit's icon from its directory viewer on the DeskEdit floppy disc to the required destination.
Note that you may run DeskEdit from an Obey file with a simple line such as:
run adfs::DeskEdit.$.!DeskEdit
run adfs::DeskEdit.$.!DeskEdit adfs::DeskEdit.$.MyCorresp adfs::Deskedit.$.PhoneBook
To save a file, click with the Menu button over the window containing the file, and move the pointer across the Save entry. Alternatively, just press function key F3. Now optionally edit the name which appears in the "Save as" box, and drag the file's icon to the directory viewer of your choice. If the file already has a full pathname (because it has been loaded from a viewer, or has previously been saved), clicking on "OK" or pressing Return will save it.
To save a Basic program that you have been editing (and re-tokenise it ready for running), either use F3, or move the pointer across the Language entry in the window menu, and then across the Basic and Save submenu entries.
By default, DeskEdit starts up in so-called Insert mode. Characters typed will be inserted, and any text to the right of the caret will be moved along to make room. In Overtype mode, text typed at the caret will replace text already present. To toggle between the two modes, use Shift-F1. If you are in Overwrite mode, the word "Overwrite" will appear in the window's title bar.
You can move around the text a character at a time using the Left, Right, Up and Down cursor keys. Shift-Left and Shift-Right move the caret one word at a time, and Ctrl-Left and Ctrl-Right take you to the start or the end of a line or paragraph.
Shift-Up and Shift-Down behave in the same way as Page up and Page down, moving up or down the text by a screenful. Finally Ctrl-Up and Ctrl-Down take you to the very top or very bottom of text (as does Home and Ctrl-Home).
If you hold down both Shift and Ctrl keys when using the Up or Down cursor keys, the text rather than the caret is moved. This can be useful if the caret is at the bottom of a window, say, and you want to look at text beyond the top of the window. Pressing Ctrl-Shift-Up will scroll the text into view without your having to wait for the caret to crawl up the screen first.
If the pointer obscures your view at any time, you can park it at the right-hand edge of the screen instantly by pressing the Break key. This is a handy shortcut if you happen to have both hands at the keyboard. Incidentally, if you cannot find the caret at any time, just press Shift-Escape and it will flash rapidly for a couple of seconds (even if Caret flash is not enabled - see section 5.4).
DeskEdit provides a further way to mark text for situations where you are not already holding the mouse. Ctrl-M will mark the character at the caret, and continue to extend the marking as long as Ctrl-M is pressed. Ctrl-Shift-M will mark a line at a time in a similar way.
To deselect a marked area, use Ctrl-Z. Alternatively, just press Escape.
DeskEdit's window menu is split into two sections divided by a dashed line, with the upper part closely following the functions of Edit. As with Edit, the window to which a given feature (in the upper part of the menu) applies is determined by the window over which the Menu button was clicked, even if that window does not have input focus. This can sometimes be a little confusing.
The features of DeskEdit controlled by the lower part of the menu may only be applied to a window with the input focus. The only consequence of this is that if you click Menu over a DeskEdit window which does not have input focus, many of the options will appear shaded on the menu, and will not be selectable. At this point, simply click with Select on the window which interests you, and then click Menu anywhere over that window (or press the appropriate shortcut key).
To update your !System application, first remove any applications which you may have running from the Desktop (since changing CLib while they are running could cause them to crash), then double-click on the !Merge application, and follow the instructions which appear in the dialogue box. Essentially you must first drag your own !System application to the Merge dialogue box, and then drag the "New" DeskEdit !System to it - and the job will be done for you. You will be prompted to insert floppy discs, as appropriate.
In many cases the features described can be accessed either via the menu system or through keyboard shortcuts. Where the latter are not function key related, and therefore do not appear on the function keystrip, you may find it best to ignore the shortcuts until you are more familiar with the package. In any case, section 7 of this manual summarises these shortcuts - as does the on-screen Help facility.
The present section deals with the upper part of DeskEdit's window menu (the entries above the dashed line).
The line length used by the wordwrapping software is that entered with the Format option (see section 2.4 below). By default it is 76, but may be set to any width. If you are not in Wordwrap mode, then text that you type will be cut when the line length reaches the number of characters set for the Work area (see section 2.5 below).
For details of how to use these features for plain text work, see section 6.1.
Note that if you are editing Basic programs, there are effectively two save options: you can save the file in the expanded (de-tokenised) textual form in which it appears for editing, by using the Save option from the main menu described here, or you can save it as a true Basic program. This latter is preferable, and is achieved either by using F3, or by selecting the Basic Save submenu, via the Language entry on the main window menu (see section 3.23 below).
For further details of using DeskEdit to edit Basic programs, see section 6.2.
Clicking Select with the Shift key held down also performs a Copy action.
As a useful alternative to Ctrl-C, Ctrl-B may be used to perform a Copy, and then automatically clear the selection. When you get used to the keyboard shortcuts, you will probably find this a more useful option than Copy on its own.
Alternatively, if you enter a text string, it will be inserted at the left-hand side of each line.
By default, the Find dialogue box starts up in Simple mode. Clicking on Magic characters puts it into Edit emulation mode, while clicking on Wildcarded expressions selects Power search mode.
If you wish to make your search case sensitive, click on the Case sensitive icon.
To simply count the occurrences of the target string, click on Count, and the result will be displayed almost instantaneously. Otherwise, clicking on Go, or pressing Return again, will commence the search. If no matching items are found, the words Not found will appear in the dialogue box; otherwise the Text found box will appear. This offers a number of options which may be selected either by clicking on the corresponding icon, or by typing a single letter at the keyboard - usually the first letter in the action word (e.g. "R" for Replace).
The icons have the following meanings:
Stop (S) | Quit the Search mode |
Continue (C) | Move on to the next find |
Replace (R) | Replace the current find, and continue |
Last replace (L) | Replace current find, then quit |
End of file replace (E) | Replace all finds to the end of the file |
Undo (U) | Undo the last event |
Redo (D) | Undo the last Undo |
Thus clicking on Continue, or simply pressing "C" at the keyboard will take you to the next find without replacing the current one. Clicking on Replace or pressing "R" will replace the current find, and take you to the next, while Last replace will replace the current find, and quit the Search and replace mode. The End of file replace option will replace all occurrences to the end of the file.
The useful option Undo ("U") allows you to step back through a sequence of finds, and to undo any replace actions. ReDo ("D") allows you to step forwards again undoing any Undos.
These special key sequences all begin with the backslash character "\"; and in all cases but one, this is followed by one further character. The sequences have the following meanings:
\. | any character |
\a | any letter or digit |
\d | any digit |
\xXX | any hex number XX |
\n | new line |
\\ | backslash itself |
\* | any string |
\& | the found string |
\cX | ctrl-X |
Thus if you search for the string:
disc\d9
If you search for:
\n\n
\n
The special sequence:
\&
table
(case insensitive)\&s
Although these special sequences provide greater power than the Simple search option, they are severely limited in a number of ways. In particular, the use of wildcards is restricted by not being able to specify characters which must not appear in a sequence. This is remedied by the Power search mode.
The following characters have special meanings in Power search mode:
. | any character |
$ | newline |
@ | any alphanumeric character |
# | any digit |
| | control character (e.g. |C means Ctrl-C) |
\ | use the following character literally (e.g. \# means "#") |
[ | start of a set of alternatives |
] | end of a set of alternatives (e.g. [abc] means "a, b or c") |
~ | logical NOT (e.g. *~$ means all chrs to the next new line) |
* | zero or more (e.g. *. is equiv to the usual "*" wildcard) |
^ | one or more characters (e.g. ^# means one or more digits) |
% | the most number of the following character |
- | to (e.g. "a-z" specifies the range from "a" to "z") |
& | the Find string (used only in Replace strings) |
? | specifies field in Find string - ?4 means 4th field |
X | hex (e.g. XFF means &FF hex) |
Some examples will make this clearer. The search string:
disc#9
dis[ck]
To count the number of numbers (as opposed to raw digits) in a file, use the search string %# and click on Count. To reduce multiple spaces in a program to single spaces, use a two character search string of a percent followed by a space, and a replace string of a single space.
To remove all REMs in a program, use the following search string:
* *:* REM*~$$
$
A final example will clarify the use of the "?" field code. This specifies a particular ambiguous element from a Find string for use in a Replace string. If you search for:
*#* *:* REM*~$$
?3
Incidentally, the GoTo dialogue box also displays the current line number, and the current character number. This can sometimes be useful.
In addition, there is a special undelete buffer. This provides complementary features. See section 5.2.
The reason for this feature is that while (like Edit), DeskEdit separates each line of text with a newline character (ASCII 10), other text editors, and notably those on the BBC Micro, use carriage return characters (ASCII 13). To make text from such an editor legible in DeskEdit, you will need to make use of this option. But if you are editing the text for use on the original system, do not forget to return it to its original state before saving it.
A format break occurs at any point where DeskEdit cannot confidently continue to format. This occurs at what are taken to be paragraph breaks (the occurrence of two adjacent newline characters), or where text appears to be intentionally indented (the occurrence of a newline character followed by one or more spaces).
When DeskEdit formats a block, it renders it ragged-right to the given line width. Formatting will always be wordwrapped, even if you do not have Wordwrap selected at the time.
If you are typing text in Wordwrap mode, you should not need to format it unless you want to alter the line width, because formatting is carried out as you type - whether you are simply adding new text, or are editing text in some way. For further details, see section 6.1.
This option is also useful for restricting the width of DeskEdit windows when using the wider screen modes. With this option in place, and a width set to 76 characters, you can use mode 16 for example, and when you click on the full size icon, the window will no longer unhelpfully expand to cover the full width of the screen.
The following features are language-specific:
The currently selected language mode for the DeskEdit window with input focus is indicated on DeskEdit's icon bar icon - with a "T" for Text, a "B" for Basic or a "C" for C. This will be altered as different windows gain input focus.
When new files are loaded, DeskEdit makes an intelligent guess at the appropriate language mode. Basic is easy to spot, while C is used for any text file whose first two characters are "/*".
When a new file is created with the Create option on the icon bar menu, the language mode assigned will be based automatically on the type of file selected. But you can also alter the language mode for any resident file by using the Language option on the window menu of the object. A tick shows the current setting.
Further leaves of this menu also allow you to set language-specific options such as automatic indentation and syntax checking - see sections 3.22 and 3.24 below.
The User Choices dialogue box (move the pointer across Choices on the icon bar menu - or press Ctrl-Shift-F10) also controls the behaviour of certain language-specific options. These largely duplicate the effect of the options from the Language submenu, but with the option to save the choices for future use. One feature controlled by the dialogue box but not the language submenu is the default language. This is simply the language assigned to new windows created by clicking on the icon bar icon. It may be set to Text, Basic or C. By default it is set to Text.
One or two of the keyboard features are language specific. In Basic mode the following take effect:
Ctrl-D | Move to the next "DEF" (for DEF PROC and DEF FN) |
Ctrl-Shift-D | Home - then move to the first "DEF" |
Ctrl-P | Move to the next "PROC" (for procedure calls & defns) |
Ctrl-Shift-P | Home - then move to the first "PROC" |
Ctrl-F | Move to the next "FN" (for function calls & defns) |
Ctrl-Shift-F | Home - then move to the first "FN" |
Ctrl-R | Move to the next "REM" |
Ctrl-Shift-R | Home - then move to the first "REM" |
In C the following are effective:
Ctrl-{ | Start a comment (insert "/* " into the source) |
Ctrl-} | End a comment (insert " */" into the source) |
If a line ends with a colon, then an indent two spaces greater than that of the previous line will be created.
Pressing Shift-Return will produce an indent two spaces less than that of the previous line.
Pressing Ctrl-Return will perform an ordinary Return.
Pressing Ctrl-Shift-Return will toggle the auto-indent feature for the currently selected language. If sound is enabled, a high beep denotes Off, while a low beep denotes On.
If you have the Strip line numbers option set (use the Choices entry in the icon bar menu to alter this), line numbers will be removed when Basic programs are loaded into DeskEdit. This makes editing a little easier, but this option is only possible if the program contains no specific line number references (e.g. no GOTOs etc.). If the program contains GOTOs you will get an error message, and will need to de-select the Strip line numbers option.
To save your edited program, either press F3, or use the window menu, following the sequence: Language then Basic then Save. If you want to save the program under its original name, just press Return - otherwise, edit the supplied name first. If you were using stripped line numbers, these will be reinstated, and the program renumbered by tens. If you did not strip line numbers, but saved a program with out-of-sequence line numbers, or with some lines without numbers, then again the program will be renumbered as it is saved.
Note that if you use the Save option from the upper half of the window menu, your program will be saved without re-tokenising, as a file of type &FD1 (BasicTx) with a very different looking icon. Such files can be loaded into DeskEdit at any time, for further editing, but unlike tokenised Basic files, they may not be run by double-clicking on them.
If you drag a tokenised Basic program into a DeskEdit window rather than the icon bar icon, then the file will not be de-tokenised, and will be loaded (or appended) byte-for-byte as it appears in the file. If you want to append the whole or a part of one program to another, first load the two programs separately into DeskEdit by dragging their icons from a directory viewer to DeskEdit's icon bar icon. Then select a part or the whole of the program to be appended. Then use the Copy option.
Additionally, the Syntax Window will appear at the top right of the screen with a message to this effect.
If syntax checking is enabled, checks will be made whenever Return is pressed, or whenever you use the Up or Down cursor keys to move away from a line which you have just edited. If an error is detected (or suspected), a high pitched beep will be heard (if sound is enabled), and the syntax window will appear with an appropriate message. The box will disappear at the next keypress.
For further details on the Syntax Checker, see sections 6.2 (Basic) and 6.3 (C).
To use Quick Search, just enter your search string into the dialogue box, and press Return (or click on OK or press F1). A find will be signalled by a low beep (if sound is enabled) and a rapid blinking of the caret for a couple of seconds (if this User Choice option is selected). To search for further occurrences (at any time) press Ctrl-N.
The Quick Search options are intended to provide a useful alternative to the Search and Replace feature (see section 2.4), over which it has the following advantages:
Because of its speed and ease of use, Quick Search is ideal for finding a particular reference in a file - for example a miss-spelt word which you need to edit, or a particular variable or function name in a program's source code.
In each case, text to be copied to the clipboard must be marked in one of the ways described in section 1.3. Text copied to the clipboard is always appended, so you may wish to clear the clipboard before some append operations. When text is pasted into your document, it will appear at the caret, so you will need to position this before embarking on a Paste operation.
Z | Append the marked block to the clipboard then clear the selection |
X | Clear the clipboard |
C | Copy the contents of the clipboard to the caret (Paste) |
V | Move the marked block to the clipboard (i.e. Append, and Delete from text) |
B | Copy the contents of the clipboard to the caret, and clear the clipboard (i.e. Paste and Empty) |
Note the broad similarity of the use of the five keys on marked blocks (when used with Ctrl on its own).
Pressing F9 at any time will then take you to marker 1, while F10 will take you to marker 2. Pressing Ctrl-F9 will take you back to the position from where you last executed an F9 jump. Thus pressing F9 and Ctrl-F9 will alternately take you between two positions. F10 and Ctrl-F10 behaves in a similar way.
Alternatively these options can be set from a dedicated dialogue box by selecting Markers from the window menu, or by pressing Ctrl-Shift-F9.
The Home key takes you to the top of text, and Ctrl-Home takes you to the end of text. Shift-Home takes you to where you were when either of these Home options was last called. If you do not make use of the Home key in the normal course of events (by using the alternative Ctrl-Up to take you to the top of text and Ctrl-Down to take you to the bottom), you can use this feature as a third Go-to marker. Move to the position that you want to recall, and press Home. Now every time that you press Shift-Home you will be taken there.
For example, Ctrl-Shift-! will take you to the first occurrence of:
REM! | if you are in Basic mode |
/*+! | if you are in C mode, and |
! | if you are in Text mode |
Ctrl-Shift-@ will take you to REM@ in Basic mode, and so on.
To make use of this feature, simply place sequences such as REM! at vital points within your source code. The search is carried out from the top of text, rather from where you happen to be when the search is initiated.
If you wish to search for further occurrences of the sequence, use Ctrl-Shift-N (N for Next).
Note that the keys /, *, #, -, + and full stop, all on the numeric keypad, also work in this way.
When you press F11 (or the alternative Alt-Select), the first "word" after the caret is taken as the search string, and you will be taken to the next occurrence of this string in the body of the document. For example, if you put the caret to the left of the following line:
REMmp Main Proc
REMmp
DEF PROCmain
You can thus have a whole menu in REMs at the start of a Basic program (or their /* */ equivalent in a C program) allowing you to move to a required procedure or function at the touch of a key.
This feature has been used extensively in developing the C source of DeskEdit itself. Here is a small part of the first lines of the source:
/* **key keypress handler **in initialise **fk func keys (keys above 127) **lk low keys **me mouse events **main main() **lc load choices **wf window functions **mw main window events **sw syntax wind events **ue unknown event processor **ich icon click handler (icon bar) */
To find the section of code dealing with the keypress handler, I just move the caret to the left of **key, and either press F11 or use Alt-Select, and I am immediately taken to the corresponding section in the body of the source code (which is marked with the same characters "**key"). If I want to go back to this point frequently, I can mark it more permanently with the F9 or F10 markers.
For a text document, the menu can take the form of a contents list:
In preparing this manual using DeskEdit, I have again made extensive use of this feature. The first page, which contains the contents list, acts as the menu, and gives instant access to all sections referred to - since the sections themselves use the same numbering system.
Note that these searches are case sensitive, and that further finds can be searched for at any time by pressing Ctrl-Shift-N (N for Next) - not to be confused with Ctrl-N which takes you to the next Quick Search find.
Searching normally starts at the point where the user index is located, and continues until a find is made or the end of text is reached. This enables the creation of sub indexes lower down a document. But if you call the index search using Shift-F11, the search will begin at the start of a document.
You will need to take care when altering filetypes, as there may be unforeseen consequences. In particular, if you change the filetype of a Basic program (which will be of type BasicTx when in DeskEdit), you will no longer be able to save it as a tokenised program.
If you wish to create a new Basic program, the best way to do this is to use the Create option from the Icon bar menu (see section 4.3).
The list of filetypes which appears in the menu is derived from a data file (!DeskEdit.Data.FTypeTable), and you may edit this to your own requirements, providing that you do not exceed a maximum of 30 entries. But note that this file is only read once when DeskEdit boots up.
If you wish to enter a new line, then use the three character sequence <|>. This will be translated into a new line when the macro is inserted into your text. Any number of new lines may be used subject to space. And since each macro may be up to 250 characters in length, great flexibility is provided. You could use macros for entering keywords in Basic, or any other language. You could even enter whole structures such as a Basic CASE statement or a switch in C. You could use one macro for your address and telephone number to go at the top of a letter, or indeed for an outline letter complete with Yours sincerely etc. at the end.
A special dialogue box is also provided for you to take stock of all ten macros for the current language. Either press Ctrl-F1 or select the Macros option from the window menu. To insert any macro into your text, just click on the corresponding Insert icon. To alter a macro, just click on the editable icon for the given macro, and type the required text - again Ctrl-U will delete the current entry. When you have finished, click on Exit and Update if you wish to retain the editings, or Exit, Update and Save if you wish to save your macro files to disc for future use. Note that all three language macro files are saved by this single action.
You may also, if you prefer, load your macro files into DeskEdit for direct editing. The files are in the directory !DeskEdit.Choice, and are named:
Headers and footers are implemented, and these can contain page numbers, filenames, times and dates in any combination. Additionally, headers and footers can be left or right aligned or centred, and may contain printer codes independently from the body of the text.
Two special dialogue boxes control the printing functions:
Before dealing with these features, we must first look at the more mundane subject of printer codes.
Ctrl-T | Bold on | <|B> |
Ctrl-Shift-T | Bold off | <|b> |
Ctrl-Y | Light on | <|L> |
Ctrl-Shift-Y | Light off | <|l> |
Ctrl-U | Underline on | <|U> |
Ctrl-Shift-U | Underline off | <|u> |
Ctrl-I | Italics on | <|I> |
Ctrl-Shift-I | Italics off | <|i> |
Ctrl-O | All styles off | <|O> |
Ctrl-P | Page break | <|P> |
Ctrl-Shift-P | Conditional page break | <|p> |
The codes appear in the text exactly as shown above, and are translated into the required effects when the DeskEdit printout option is selected from the Hardcopy dialogue box (see below). Codes may be used in any combination, so you could for example have a section of text in bold italic underlined.
Page breaks and conditional page breaks have been implemented using Ctrl-P and Ctrl-Shift-P respectively. The latter will cause a page break if it occurs within 6 lines of the bottom of text on any given page.
Note that the keys used for these operations are grouped together on the keyboard, and that in most cases the letter suggests the effect. U for Underline, I for Italics, O for Ordinary style, P for page break. T can be thought of as Thick (i.e. Bold), but Y is not really suggestive of light.
The text height should be the exact number of lines which could in principle be fitted onto a page. The default is 68. The text width is the number of characters which your printer can accommodate on a single line. The top and bottom margins are the number of blank lines that you require (ignoring headers and footers) at the top and bottom of the body of text. The left margin and the alternate margin should be set to the same number of characters unless you require alternate pages to have a different left-hand margin - as you might if you were going to use double-sided photocopies of the printed output.
The overhang is the additional indent that you require for lines which exceed the stated maximum length. This should normally only happen with program listings and the like. The default is 2, meaning that split lines will be indented two characters to the right of normal lines. The overhang may also be set to a negative value, but should never take the line back further than the minimum margin set. Thus if you have set a left-hand margin of 4, the overhang should never be less than -4.
To save the current printer setup, move the pointer across the Save printer setup option on the icon bar menu. This will supply a "Save as" dialogue box allowing you to edit the name of the setup file. The default name is "PtrDefault". This is also the name of the setup file which is loaded when DeskEdit is first installed.
If you decide to edit the name used to save your data, you should only alter the so-called leafname (the characters to the right of the last full stop in the supplied name). This is because Page setup data is stored in a special directory (called Choices) within the DeskEdit application directory.
You will see that the file has a special DeskEdit icon, and if you wish to load a new setup file at any time, just drag the file's icon from a directory viewer to DeskEdit's icon bar icon. You will hear a confirmatory beep if sound is enabled. So that you can distinguish your printer setup files, it might be worth giving them names which begin with the letters "Ptr", but this is not essential.
Since dragging DeskEdit files (i.e. files with the DeskEdit icon like the setup file) to the DeskEdit icon causes them to be acted upon rather than loaded into a window ready for editing, we need a way to load them into DeskEdit in order to view or edit them. There are two ways to do this. Either drag the file to the icon with the Ctrl key held down, or open a new DeskEdit window by clicking on the icon bar icon, and then drag the setup file directly to the empty window.
Writable icons are provided in the Page setup dialogue box for entering the text for the header and footer. This can be a normal text string including spaces where appropriate. But special codes are also permitted, as follows:
<|C> | Centre the text |
<|R> | Right align the text |
<|F> | Insert the filename |
<|D> | Insert the date |
<|T> | Insert the time |
<|N> | Insert the page number |
<|N+n> | Insert page no with positive numeric offset |
<|N-n> | Insert page no with negative numeric offset |
Additionally, the following printer codes may be incorporated:
<|B> | Bold |
<|L> | Light |
<|U> | Underline |
<|I> | Italics |
In the case of headers and footers, there is no single key shortcut for entering these codes.
Note that all codes may appear anywhere in the text that you require, but that the printer and position codes will affect the whole header or footer. Thus, for example the header:
<|B>Filename: <|F><|R><|I>
DeskEdit ensures that header and footer printer codes do not interact with those used for the main body of the text.
When you are satisfied with the printer setup selections, click on the OK icon. If you click on the Cancel icon, or click outside the dialogue box, the settings will revert back to their previous values.
To save the settings for future use, click on the Save setup entry on the icon bar menu.
Finally, there are four print actions to choose from:
Statistics displays a summary of information about the proposed printout, including the number of characters, words and lines - and most importantly the number of pages which would be used. If you have a program source, and are contemplating printing it out, it can be very useful to know exactly how much paper it will take up before you start things going.
Preview installs a new DeskEdit window containing an exact copy of what would be sent to the printer - except that print style codes are not included. This allows you to carefully check that all is as it should be before printing takes place. In particular, you can check line and page breaks, headers, footers and page numbering.
Literal print provides a way of avoiding the use of any of DeskEdit's features. It sends the file directly to the printer drivers, without processing it in any way. Even the margin and page length details will be ignored.
Full feature print is the default printout option for DeskEdit. It makes use of all the features outlined above, and will generate an exact copy of what appears in the Preview window, except of course that printer codes will be effective.
If a selection has been made in the text, you will be asked if the print/preview/statistics options refer to the selection only, or to the whole of the text. By making a selection, and then choosing the Statistics option, you can easily obtain character, word, line and page counts for arbitrary sections of text.
The features provided by DeskEdit require the use of Acorn's printer drivers, version 2.4 or later, and copies of these may be obtained from your local Acorn dealer. When you first install these, you will need to set the number of lines per page, and the number of characters per line to the same values as are used in DeskEdit (on the Printer Driver Page set up dialogue box), and you will also need to set the top, bottom and left margins to zero on the printer driver, and to turn off the Header option. You should then save these choices (to avoid needing to reset them each time you install the driver).
The reason for cancelling these options on the driver is to prevent the driver from trying to apply its own margins and headers from a text file which already contains them. The effect of this will be that any text file which you drag from the Filer to the driver will also use these settings. However, if you double-click on the text file instead, it will automatically be loaded into DeskEdit (providing that DeskEdit has been seen by the filer), and you can then print it directly from DeskEdit with all the defaults which you have set up. Of course, you could also reset the Driver's margins, but this could be a little tedious, and the printout facilities offered by DeskEdit are superior to those available through the printer driver on its own.
A better approach would be to keep two versions of the printer driver which you use: one with zero margins etc. for use with DeskEdit, and the other set up for printing normal text documents. You could then use DeskEdit's User Command menu to install the appropriate driver. If you are using floppies, it may well be worth keeping a copy of the DeskEdit version of your printer driver on your DeskEdit disc.
These are very powerful features, and allow you to control your whole Desktop from a single menu. For example, by keeping an entry for each of your most frequently used tasks, you can run any of them very quickly indeed without having to get to the right point in your directory structure, and scroll directory viewers before finding the icon of your choice.
To set up this feature, you will need to edit the file:
!DeskEdit.Data.Commands
Each non-remark line must consist of a menu entry of maximum length 15 characters, followed by an equals sign, followed by the command. The command may be up to 100 characters in length, and a maximum of 20 entries are permitted.
To start a new task, preface the task name with \s followed by one or more spaces. For example:
ArcScan=\s adfs::AscnDisc.$.!ArcScan
To open a filer window, use a preface of \f. For example:
Open root=\f adfs::0.$
To launch an Obey file, use a preface of \o For example:
Set Keys=\o adfs::WorkDisc.Library.FuncKeys
The result of including the three lines given here would be a three-entry Command submenu with the following effects:
ArcScan | Install ArcScan on the icon bar |
Open root | Open a filer window on the root directory of your disc |
Set keys | Launch an Obey file to set up the function keys |
A bar "|" before an entry gives a dashed line above it in the menu. This is useful for visually separating groups of entries. The default Commands file supplied with this package uses this feature.
The Help option provides on-screen help, and is also available from the window menus. The Page setup, Save page setup and User commands entries have been dealt with above.
The Quit option has the expected effect, and will remove DeskEdit from the icon bar. If any DeskEdit window contains modified (and unsaved data) you will be warned before the task is closed down.
Because such warnings can sometimes be unhelpful when you know what is at risk, a special option allows you to exit the package without the warnings. Just hold down the Shift key while clicking on Quit.
The Sound option is not dealt with elsewhere. This simply allows you to switch on or off the Sound feature. When enabled, you will hear confirmatory beeps during various DeskEdit activities. For example, pressing Ctrl-Shift-Return toggles the auto indent feature. When it is turned on you will hear a low beep - providing that sound is enabled - and a high beep when it is disabled.
The three icons at the bottom of the dialogue box are fairly self-explanatory. The middle one will update your choices, while the rightmost will both update them, and save them to a file so that they can be used next time that DeskEdit is invoked.
Alternatively you can enter them by holding down the Alt key and entering the ASCII value of the required code in decimal at the numeric keypad, and then releasing the Alt key (again this will not work for the majority of control codes when the Control Codes option is off).
The following keys can still be used as normal in this mode:
The ASCII values for carriage return, newline, delete, and backspace may still be entered however, using the Alt key. Thus to enter 127 (delete) hold down the Alt key, and enter the number 127 on the numeric keypad, and then release Alt.
Note that while the Return key has a key value of 13, it actually enters the ASCII value 10 into the text. This appears as a new line, and no character is displayed. If you enter the value 10 at the numeric keypad with Alt pressed, you will therefore get a new line, while entering 13 will give the sign for ASCII 13 "[0d]".
To use DeskEdit's Undelete feature, just position the caret where you want to insert the deleted text, and press Insert to insert a character at a time, Shift-Insert to insert a word at a time, or Ctrl Insert to insert a line at a time. The buffer is organised so that text deleted backwards with the Delete key, and text deleted forwards with the Copy key both re-emerge in a useful order, as far as possible.
Attempting to use Insert when the buffer is empty produces a warning beep if sound is enabled.
A special option is provided for clearing the buffer. Just press Shift-Ctrl-Copy. A low beep signals that the operation has been performed. It is sometimes useful to clear the buffer before deleting sections of text that you know you want to reinsert elsewhere, since it will avoid previously deleted characters appearing at the end of the undelete sequence.
The undelete buffer is cyclic, and is 5K in length.
The only exception to this is files of type DeskEdit (type C62): these carry the special DeskEdit file icon, and dragging one of these results in the file being acted upon in some way, rather than being loaded into a window for editing. For example, if you drag a printer setup file to DeskEdit's icon, a new set of printer setup data will be read in from that file. To load such a file into DeskEdit for editing purposes, drag the file to DeskEdit's icon bar icon with the Ctrl key held down.
If you select Flash icons it will also flash when it is displayed within an icon. This is not usually necessary, since the caret is never hard to find when constrained to a writable icon.
If you select Flash apps in addition to Caret flash then the caret will flash whether it is owned by DeskEdit or not. This can sometimes be useful if you are running another text processing application - such as a DTP package - which does not have the ability to flash the caret.
If you select the Flash finds entry, then finds in the Quick search and Position finder will be signalled by a rapid flashing of the caret, even if normal caret flash is not enabled.
You can alter the flash speed by clicking on the arrow icons accompanying the Time on and Time off entries (use the Adjust button so as to keep the dialogue box on screen). When you are happy with your selections, click on Update, save and exit to save the selections for future use.
Letter | Feature | Value if unspecified |
F | Text colour | 7 |
B | Background colour | 0 |
W | Font width | 10 |
H | Font height | 10 |
M | Left margin in pixels | 0 |
L | Extra spacing between lines | 0 |
R | Word wrap | no wrap |
N | Font name | system font |
U | Size of undelete buffer | 5000 bytes |
As an example of how this works, the following line in DeskEdit's !Run file is used to set the foreground colour of DeskEdit windows (i.e. the text colour) to white, and the background colour to black:
Set DeskEdit$Options F0 B7
To alter the way in which DeskEdit starts up, you will need to open the DeskEdit application directory (double-click on the DeskEdit icon in its directory viewer with the Shift key held down). Then drag the !Run file into DeskEdit, and edit it accordingly - remembering to save it back again afterwards.
For example, to keep the present colour scheme, but turn on word wrap and set an Undelete buffer size of 10000 bytes, use:
Set DeskEdit$Options F0 B7 W U10000
These changes will not take effect until you next install DeskEdit. Additionally, not that if the environment variable DeskEdit$Options has not been assigned a value (because there is no reference to it in DeskEdit's !Run file for example), then DeskEdit will make use of the options currently set up for Edit in the variable Edit$Options - should this variable happen to be assigned.
It is tedious to have to reformat to some other width at a later stage, so it is worth getting this right straight away. You will need to select a width which allows you enough room on your printer paper, taking into account any left-hand margin that you may require. This latter will be set on the Page Setup dialogue box when you come to print out your work.
To take an example, suppose that you want a left-hand margin of 4 characters, and your printer will handle text up to 77 characters wide, you must set the Format width to 73 at the very most. If you require a small margin on the right-hand side of the page, you will need to reduce this a little. Perhaps 70 would be a good width to go for in this case. Now select Wordwrap by pressing Ctrl-F5, and the job is done.
Because DeskEdit has no way of knowing how you want your text formatted, it will not always do it the way you want it. In particular, if you have a heading, and normal text without a paragraph indent follows on the line immediately below the heading, it will format the heading in with the body of text if alterations are made to the heading itself. The simplest way to avoid this is either to indent the line after such a heading (e.g. by indenting all paragraphs), or to place a blank line after the heading. Otherwise, switch off Wordwrap by pressing Ctrl-F5 just before editing the heading, and then switch in on again afterwards with a second press of Ctrl-F5.
Note that if you do get unwanted formatting at any time, you can just hit F8 (Undo) to return your text to its former state.
A key factor worth remembering is that whether formatting is activated by pressing Ctrl-F6, or by Wordwrap as you type, the section formatted always starts at the caret and works down the screen. No text before the caret is ever formatted; and formatting ends where a newline is followed either by another newline, or by a space.
DeskEdit does not reformat when Return is pressed, so if you are splitting a line using the Return key, you will need to reformat the following text. The most effective way to do this is to use Ctrl-F6 (Format block).
If you are typing into a line which already contains text to the right of the caret, make sure that there is at least one space immediately to the right of the caret. This will ensure that correct formatting is achieved first time - otherwise the word which you are typing will be joined to text already present, and formatting will be performed on the basis of the combined length of this "word".
If you wish to insert a pad character in order to join two words which must not be broken over a new line, just use Alt-space. In other words hold down the Alt key, and press the space bar. This inserts character 160 which looks identical to a space, but which is treated differently by the formatter.
If you are loading a Basic program from disc, just drag its icon to DeskEdit's icon bar icon. If you have selected the Strip line numbers option, then line numbers will be stripped as the program is de-tokenised ready for editing. However, if your program has direct line number references (such as GOTOs etc.), this is not possible, and an error message will appear. You will then need to deselect the Strip option (use the icon bar menu entry Choices) and try again.
It is much easier to edit with the line numbers stripped, and it is likewise good programming practice to avoid the use of GOTOs.
When editing Basic you will need to ensure that the Wordwrap option is Off (this is the default) - check that the word Wordwrap does not appear in the window's title bar.
Most of the features of DeskEdit will be useful for editing Basic programs. The various position finders will help you to find your way around your code (see section 3.5), while the wide range of Search options will also be very useful.
One or two features are specifically for use in Basic mode. The Syntax Checker can be used to perform simple syntax checking as you type (in fact checks are made when Return is pressed, or when you press Cursor Up or Down after editing a line). Checks are made to verify that parentheses and quotation marks match, and that certain keywords are correctly used.
Additionally the following features are implemented:
Ctrl-D | Move to the next "DEF" (for DEF PROC and DEF FN) |
Ctrl-Shift-D | Home - then move to the first "DEF" |
Ctrl-P | Move to the next "PROC" (for procedure calls & defns) |
Ctrl-Shift-P | Home - then move to the first "PROC" |
Ctrl-F | Move to the next "FN" (for function calls & defns) |
Ctrl-Shift-F | Home - then move to the first "FN" |
Ctrl-R | Move to the next "REM" |
Ctrl-Shift-R | Home - then move to the first "REM" |
Thus for instance, to move to the start of each function and procedure definition in your program in turn, just press Ctrl-Shift-D to move to the first, then Ctrl-D to move to each subsequent one.
Basic has its own set of ten text macros. The first four of these are initially set to create a dashed REM line, and to generate the keywords DEF PROC, DEF FN and ENDPROC, respectively - but each may be defined to hold any string of up to 250 characters in length to suit your own requirements.
Finally, remember the Save File shortcut. This is F3, and it will automatically re-tokenise Basic programs as an integral part of the Save operation, rendering them into a state ready for running. When you are editing Basic, it is a wise precaution to use F3 at regular intervals (just press F3 Return) to keep your work safe. To test a program that you are developing, keep its icon visible, and double-click on this to run the program after saving it using F3. Alternatively, use the User Commands feature (see section 3.9) to launch your test program or application from DeskEdit's icon bar menu.
If a plain text file is loaded into DeskEdit, it will be assumed to be C source code if the first two characters in the file are /*. These are used in C to begin a comment. If you expect to be loading a source file back into DeskEdit at a later date, then it is worth ensuring that these two characters are indeed the first two in the file - otherwise you will need to use the Language option on the window menu to set the language mode to C.
When in C language mode, the C text macros come into effect - for example, try pressing Ctrl-0 (using the zero of the numeric keypad) when you have input focus on a DeskEdit window in C mode. A remark line consisting of a series of dashes will be inserted into your source - useful for separating off one piece of code from another. Ctrl-7 and Ctrl-8 (again both at the numeric keypad) generate the useful #if FALSE and #endif pair of preprocessor directives. Other macros are also defined - and of course you can redefine all ten to suit your requirements (see section 3.7).
In C language mode, Ctrl-{ and Ctrl-} will insert the three character sequence "/* " and " */" to open or close a comment, respectively.
The auto-indent facility is also particularly useful when writing C source code. This feature is toggled by Ctrl-Shift-Return and may also be enabled or disabled from both the C submenu of the Language entry in the window menu, and from the Choices dialogue box (which also permits your selections to be saved for future use).
When Auto indent is switched on, pressing Return will cause the new line to be indented to match the present line. Using Shift-Return reduces the generated indent by two character positions, while Ctrl-Return generates a new line with no indent whatsoever.
Use of this feature enables you to create blocks of aligned code - important for clarity of meaning. A further feature automatically inserts indents under certain circumstances e.g. when Return is pressed on a line ending in a colon or an open brace. These features automatically generate the style of indentation frequently used in C source.
For example, if you type:
void my_func(int a)
void my_func(int a)
Pressing Return again will start a new line indented beneath the brace. If the following two lines were:
int b;
char *c;
void my_func(int a)
{
int b;
char *c;
And in this the open brace and the two indents have been automatically generated by DeskEdit.
Additionally, the Syntax Window will appear at the top right of the screen with a message to this effect.
If syntax checking is enabled, checks will be made whenever Return is pressed, or whenever you use the Up or Down cursor keys to move away from a line which you have just edited. If an error is detected (or suspected), a high pitched beep will be heard (if sound is enabled), and the syntax window will appear with an appropriate message. The box will disappear at the next keypress.
One way in which the Syntax Checker decides if a given line is within a comment is by looking at the sequence of Ctrl-Shift-{ and Ctrl-Shift-} pairs typed by the user. These respectively generate the sequence:
In C, the correctness of any given line is often context sensitive, and since this checker is line based, it is not able to check for context (which may not even be in place at the time that the check is made). It therefore makes educated guesses, and will sometimes warn when there is no error. Nevertheless, the Syntax Checker will help to avoid time wasted compiling code containing syntax errors.
Some minor features - such as insert date and filename, park the mouse etc. - may only be operated via the keyboard.
Many of the shortcuts are function-key operated. These are not listed here, because the function keystrip supplied with DeskEdit should provide a satisfactory aide-mémoire.
Break | Park the mouse pointer |
Escape | Unmark marked text |
Shift-Escape | Temporary caret flash |
Ctrl-Enter | Curr window to back |
Shift-Ctrl-Ent | Curr window to front |
Ctrl-F | Insert leafname of file (Text mode only) |
Ctrl-D | Insert date (Text and C modes only) |
Ctrl-S | Swap case of character at caret |
Ctrl-Shift-S | Swap order of the 2 characters following the caret |
Ctrl-L | Force to lower case |
Ctrl-Shift-L | Force to upper case |
Ctrl-K | Force into mixed case (caps for 1st char of a word) |
Ctrl-Q | Toggle syntax check on/off |
Ctrl-M | Mark chr at caret, and move caret by one character |
Ctrl-Shift-M | Mark line at caret, and move down one line |
Ctrl-N | Next find in Quick Search |
Ctrl-Shift-N | Next find in Position Find |
Ctrl-Shift-Ret | Toggle auto-indent |
Display Hardcopy options | |
Shift-Print | Display Page Set Up options |
Ctrl-D | Move to the next "DEF" (for DEF PROC and DEF FN) |
Ctrl-Shift-D | Home - then move to the first "DEF" |
Ctrl-P | Move to the next "PROC" (for proc calls & defns) |
Ctrl-Shift-P | Home - then move to the first "PROC" |
Ctrl-F | Move to the next "FN" (for function calls & defns) |
Ctrl-Shift-F | Home - then move to the first "FN" |
Ctrl-R | Move to the next "REM" |
Ctrl-Shift-R | Home - then move to the first "REM" |
Ctrl-{ | Start a comment (insert "/* " into the source) |
Ctrl-} | End a comment (insert " */" into the source) |
!@#$%^&*()-+"/
Ctrl-Z | Unmark marked text |
Escape | ditto |
Ctrl-X | Delete marked text |
Ctrl-C | Copy marked text |
Ctrl-V | Move marked text and clear marks |
Ctrl-B | Copy marked text and clear marks |
Ctrl-Shift-Z | Append to board and clear selection |
Ctrl-Shift-X | Clear board (delete) |
Ctrl-Shift-C | Paste to caret (copy from board) |
Ctrl-Shift-V | Append to board and delete selected text (move) |
Ctrl-Shift-B | Paste to caret and clear board |
Ctrl | Ctrl-Sh | |
T Bold | On | Off (T=Thick) |
Y Light | On | Off |
U Underline | On | Off |
I Italic | On | Off |
O All Styles | Off | - |
P Page break | Hard | Conditional |
Styles can be used in any combination.
Ctrl-O can be used at any time to kill all styles.
Shift-Select | Copy marked text |
Ctrl-Select | Clear marks |
Alt-Select | Invoke generalised position finder - equivalent to moving caret then pressing F11 |
Ctrl-Select | On Close icon will close a DeskEdit window without warnings |
Ctrl-Select | On the Quit entry in the menu will exit DeskEdit without warnings |